package com.xg.xmall.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xg.comm.pojo.TreeNode;
import com.xg.xmall.service.ItemCatService;

@Controller
@RequestMapping("/item/cat")
public class ItemCatController {

	@Autowired
	private ItemCatService itemCatService;
	@RequestMapping("/list")
	@ResponseBody
	private List<TreeNode> getCatList(@RequestParam(value="id",defaultValue="0")Long parentId){
		List<TreeNode> list = itemCatService.getItemCatList(parentId);
		return list;
		
	}
	
}
